import Https from '@/utils/https'

// 获取指标目录(后端做了树形结构封装)
const listCatalog = (params) => Https.get('/api/v1/index/listCatalog', params)
// 获取所有部门(数据owner)
const getDepartList = (params) => Https.get('/api/v1/index/getDepartList', params)
// 指标关联保存修改取消，取消就是indexCorrelation里面不塞数据
const saveIndexCorrelation = (params) => Https.post('/api/v1/index/saveIndexCorrelation', params)
// 离线开发保存工作流(点击离线开发按钮，若指标信息包含nodeId前端直接跳转)
const saveTaskFlow = (params) => Https.post('/api/v1/index/taskFlow/save', params, { needCode: true, json: false })
// 查询离线开发工作流目录
const getTree = (params) => Https.get('/api/v1/index/offlineTree', params)
// 查看所有数据(select *)，第一次查询的时候调用此接口
const getDataAll = (params) => Https.get('/api/v1/index/getDataAll', params)
// 当取消关联时，前端给出提示
const alarmDisassociate = (params) => Https.get('/api/v1/index/alarmDisassociate', params)

export {
  listCatalog, getDepartList, saveIndexCorrelation, saveTaskFlow, getTree, getDataAll, alarmDisassociate,
}
